package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the CUST_COMPLAINT database table.
 * 
 */
@Embeddable
public class CustComplaintPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="ORDER_ID")
	private long orderId;

	@Column(name="CUST_REP_ID")
	private long custRepId;

	@Temporal(TemporalType.DATE)
	@Column(name="COMPLAINT_DATE")
	private java.util.Date complaintDate;

	public CustComplaintPK() {
	}
	public long getOrderId() {
		return this.orderId;
	}
	public void setOrderId(long orderId) {
		this.orderId = orderId;
	}
	public long getCustRepId() {
		return this.custRepId;
	}
	public void setCustRepId(long custRepId) {
		this.custRepId = custRepId;
	}
	public java.util.Date getComplaintDate() {
		return this.complaintDate;
	}
	public void setComplaintDate(java.util.Date complaintDate) {
		this.complaintDate = complaintDate;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CustComplaintPK)) {
			return false;
		}
		CustComplaintPK castOther = (CustComplaintPK)other;
		return 
			(this.orderId == castOther.orderId)
			&& (this.custRepId == castOther.custRepId)
			&& this.complaintDate.equals(castOther.complaintDate);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.orderId ^ (this.orderId >>> 32)));
		hash = hash * prime + ((int) (this.custRepId ^ (this.custRepId >>> 32)));
		hash = hash * prime + this.complaintDate.hashCode();
		
		return hash;
	}
}